#pragma once
#include "SrvBaseImp.h"
#include "signalapp_i.h"
#include "mscomhelper\UseConnectionPoint.h"
#include "tray\traysrvplugin.h"
#include "kanmm_i.h"



// {7527F870-65CF-4232-967C-D88348A36E45}
MS_DEFINE_GUID(CLSID_MainPlugin, 
			   0x7527f870, 0x65cf, 0x4232, 0x96, 0x7c, 0xd8, 0x83, 0x48, 0xa3, 0x6e, 0x45);

class CMainPlugin:
	public IExit,
	public ISingleAppMsgConnectPoint,
	public CSrvPluginImp<CMainPlugin>
{
public:
	UNKNOWN_IMP4_( IMsPlugin , IMsPluginRun,ISingleAppMsgConnectPoint,IExit);
	//MS_BEGIN_DEFINE_MSG(CMainPlugin)
		/*MS_DEFINE_MSG(MSGID_TranslateSource)*/
	//MS_END_DEFINE_MSG

	//MS_BEGIN_MSG_MAP(CMainPlugin)
		/*MS_MSG_MAP(MSGID_TranslateSource,OnTranslateSource)*/
		//MS_DEFAULT_MSG(OnDefaultMsg)
	//MS_END_MSG_MAP

	CMainPlugin(void);
	~CMainPlugin(void);

	virtual HRESULT OnAfterInit(void*);
	virtual HRESULT OnBeforeUnint();
	virtual HRESULT OnAfterStart();
	virtual HRESULT OnBeforeStop();

	STDMETHOD(NotifyExit)(bool* bExit = NULL);
	STDMETHOD(OnSingleAppMsg)(IXMLTree3* lpArgXml , BOOL& bHandle);

	HRESULT CreateUiFrame();
	HRESULT DistoryUiFrame();

	//msc message
	HRESULT OnTranslateSource(RSMSGID msgid, IMsBuffer* pBuf);
	HRESULT OnDefaultMsg(RSMSGID msgid,IMsBuffer* pBuf);
public:
	UseConnectPoint<ISingleAppMsgConnectPoint>  m_pSignalApp;
	UTIL::com_ptr<IFrameWindow> m_pFrameWindow;
	
};

